<script type="text/javascript" src="../js/admin.js"></script>
<%@page import="controller.AdminRequestHelper"%>
<%
    String content = (String) request.getAttribute(AdminRequestHelper.contentParameterName);
    String operation = (String) request.getAttribute(AdminRequestHelper.operationParameterName);
%>


<div class="adminmenu">
    <a href="admin.jsp?content=user">Users</a>
    <a href="admin.jsp?content=group">Groups</a>
</div>

<div id="options"> 
    <%
        if ("user".equals(content)) {
            if ("create".equals(operation)) {
    %>
    <input type="button" class="adminButton" value="Save" id="save_created_user" onclick="save_created_user()"/>
    <input type="button" class="adminButton" value="Cancel" onclick="window.location.replace('admin.jsp?content=<%= content%>');"/>
    <%
        }
        if ("view".equals(operation)) {
    %>
    <input type="button" class="adminButton" value="Edit" id="edit_user_btn" onclick="edit_user()" />
    <input type="button" class="adminButton" value="Delete" id="delete_user_btn" onclick="delete_user()" />
    <%            }
        if (operation == null) {
    %>
    <input type="button" class="adminButton" value="Create" onclick="window.location.replace('admin.jsp?content=<%= content%>&operation=create');"/>
    <input type="button" class="adminButton" value="Delete" id="delete_users_btn" /> 
    <%
            }
        }

        if ("group".equals(content)) {
            if ("create".equals(operation)) {
    %>
    <input type="button" class="adminButton" value="Save" id="save_group"/>
    <input type="button" class="adminButton" value="Cancel" onclick="window.location.replace('admin.jsp?content=<%= content%>');"/>
    <%
        }
        if ("view".equals(operation)) {
    %>
    <input type="button" class="adminButton" value="Edit" id="edit_group_btn" />
    <input type="button" class="adminButton" value="Delete" id="delete_group_btn" />
    <%            }
        if (operation == null) {
    %>
    <input type="button" class="adminButton" value="Create" onclick="window.location.replace('admin.jsp?content=<%= content%>&operation=create');"/>
    <input type="button" class="adminButton" value="Delete" id="delete_groups_btn" /> 
    <%
            }

        }

    %>
</div>
